Purpose: To learn about java commands
such as escape sequenses and the println and print.
If you do not understand this assignment, ask Mr. Cusack and/or come to his tutorials.
You will need to create a java program.
Google an example of a "Java Hello World" program.
Use it as your guide to build your own Hello World java program.
Open Notepad. Save your file as PX_Hello_Lastname.java.
Be sure to save it under your directory with all your classes.
Be sure to store your program in Eclipse under your
class directory we set up at the beginning of the year.
Remember you should have a package that is called period X
(where X is your class period)
We will be introducing java escape sequences.
Detail you need to add:
package cusack;
public class P1_EnhancedHelloWorld_lastname {
public static void main(String[] args) {
System.out.print("Enhanced Hello World\n\n");
System.out.print("I rock\nI know that\nif I work hard");
System.out.println("that I can be successful at\n");
System.out.print("I need to \"Focus\"");
System.out.print("\nto be successful at \\computer science\\");
// (You need to replace my name with yours)
System.out.print("\nMy name is \"Joe Cusack\"");
System.out.println(" Enhanced Hello world!");
}
}
Click here to watch video instructions.
Click here for additional information (youtube)
• Your files will be:
• PX_HelloWorld_lastname.txt (text only)
• PX_HelloWorld_lastname.java (java program)
• PX_HelloWorld_lastname.png (Screen print)
• PX_HelloWorld_lastname.mp4 (video of you running your program)
• Drop off all 4 files into google classroom.
**************************************************
Below is what your output to the console should
look like after following my direction and
making a few correction based on how my output look below.
(with the exception that your name has replaced mine)
**************************************************
Enhanced Hello World
I rock
I know that
if I work hardthat I can be successful at
I need to "Focus"
to be successful at \computer science\
My name is "Joe Cusack" Enhanced Hello world!
**************************************************